package client.presen.componentes;


import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;
import java.awt.Color;
import javax.swing.BorderFactory;

import client.presen.IVentanaJugador;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.rmi.RemoteException;
import javax.swing.JLabel;
import javax.swing.SwingConstants;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class JPTableroKenken extends JPanel {
	
	private JTextField jtf10 = null;
	private JTextField jtf11 = null;
	private JTextField jtf00 = null;
	private JTextField jtf01 = null;
	private JTextField jtf02 = null;
	private JTextField jtf03 = null;
	private JTextField jtf04 = null;
	private JTextField jtf05 = null;
	private JTextField jtf12 = null;
	private JTextField jtf13 = null;
	private JTextField jtf14 = null;
	private JTextField jtf15 = null;
	private JTextField jtf20 = null;
	private JTextField jtf21 = null;
	private JTextField jtf22 = null;
	private JTextField jtf23 = null;
	private JTextField jtf24 = null;
	private JTextField jtf25 = null;
	private JTextField jtf30 = null;
	private JTextField jtf31 = null;
	private JTextField jtf32 = null;
	private JTextField jtf33 = null;
	private JTextField jtf34 = null;
	private JTextField jtf35 = null;
	private JTextField jtf40 = null;
	private JTextField jtf41 = null;
	private JTextField jtf42 = null;
	private JTextField jtf43 = null;
	private JTextField jtf44 = null;
	private JTextField jtf45 = null;
	private JTextField jtf50 = null;
	private JTextField jtf51 = null;
	private JTextField jtf52 = null;
	private JTextField jtf53 = null;
	private JTextField jtf54 = null;
	private JTextField jtf55 = null;

	
	/**
	 * Create the panel.
	 * @param ventana 
	 * @wbp.parser.constructor
	 */
	public JPTableroKenken(IVentanaJugador ventana) {
		super();
		initialize();
		//this.ventanaJugador=ventana;
		//aki hace por cada cuadricula setVentanaJugador
		
	}
	public JPTableroKenken(String kenken, IVentanaJugador ventana) {
		this(ventana); //constructor anterior
		initialize();
		load(kenken); //lee el kenken del servidor
	}
	
	public void load(String kenken) {
		// TODO Auto-generated method stub
		JPTableroKenken j=null;
		int fila=0, columna=0;
		char color,op, valor;
		for (int i=0; i<kenken.length(); i+=10) {
			fila = (int)kenken.charAt(i);
			columna = (int)kenken.charAt(i+2);
			color = kenken.charAt(i+4);
			valor = kenken.charAt(i+6);
			op = kenken.charAt(i+8);
			
			j.putValue(valor, fila, columna, color);
		}
	}
	
	private  void initialize() {
		this.setLayout(null);
		this.setSize(342, 201);
		this.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
		this.add(getJ(), null);
		this.add(getJ1(), null);
		this.add(getJ2(), null);
		this.add(getJ3(), null);
		this.add(getJ4(), null);
		this.add(getJ5(), null);
		this.add(getJ6(), null);
		this.add(getJ7(), null);
		this.add(getJ8(), null);
		this.add(getJ9(), null);
		this.add(getJ10(), null);
		this.add(getJ11(), null);
		this.add(getJ12(), null);
		this.add(getJ13(), null);
		this.add(getJ14(), null);
		this.add(getJ15(), null);
		this.add(getJ16(), null);
		this.add(getJ17(), null);
		this.add(getJ18(), null);
		this.add(getJ19(), null);
		this.add(getJ20(), null);
		this.add(getJ21(), null);
		this.add(getJ22(), null);
		this.add(getJ23(), null);
		this.add(getJ24(), null);
		this.add(getJ25(), null);
		this.add(getJ26(), null);
		this.add(getJ27(), null);
		this.add(getJ28(), null);
		this.add(getJ29(), null);
		this.add(getJ30(), null);
		this.add(getJ31(), null);
		this.add(getJ32(), null);
		this.add(getJ33(), null);
		this.add(getJ34(), null);
		this.add(getJ35(), null);		
		add(getTextField());
		add(getTextField_1());
		add(getTextField_2());
		add(getTextField_3());
		add(getTextField_4());
		add(getTextField_5());
	}
	
	
	private JTextField getJ35() {
		if (jtf55 == null){
			jtf55 = new JTextField();
			jtf55.setBackground(new Color(238, 232, 170));
			jtf55.setColumns(10);
			jtf55.setBounds(170, 146, 28, 25);
			jtf55.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));	
			jtf55.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf55,(byte)5, (byte)5);
				}
			});
		}
		return jtf55;
	}
	private JTextField getJ34() {
		if (jtf54 == null){
			jtf54 = new JTextField();
			jtf54.setBackground(new Color(238, 232, 170));
			jtf54.setColumns(10);
			jtf54.setBounds(142, 146, 28, 25);
			jtf54.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf54.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf54,(byte)5, (byte)4);
				}
			});
		}
		return jtf54;
	}
	private JTextField getJ33() {
		if (jtf53 == null){
			jtf53 = new JTextField();
			jtf53.setColumns(10);
			jtf53.setBounds(114, 146, 28, 25);
			jtf53.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf53.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf53,(byte)5, (byte)3);
				}
			});
		}
		return jtf53;
	}
	private JTextField getJ32() {
		if (jtf52 == null){
			jtf52 = new JTextField();
			jtf52.setColumns(10);
			jtf52.setBounds(86, 146, 28, 25);
			jtf52.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf52.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf52,(byte)5, (byte)2);
				}
			});
		}
		return jtf52;
	}
	private JTextField getJ31() {
		if (jtf51 == null){
			jtf51 = new JTextField();
			jtf51.setBackground(new Color(255, 222, 173));
			jtf51.setColumns(10);
			jtf51.setBounds(58, 146, 28, 25);
			jtf51.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf51.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf51,(byte)5, (byte)1);
				}
			});
		}
		return jtf51;
	}
	private JTextField getJ30() {
		if (jtf50 == null){
			jtf50 = new JTextField();
			jtf50.setBackground(new Color(255, 222, 173));
			jtf50.setColumns(10);
			jtf50.setBounds(30, 146, 28, 25);
			jtf50.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf50.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf50,(byte)5, (byte)0);
				}
			});
		}
		return jtf50;
	}
	private JTextField getJ29() {
		if (jtf45 == null){
			jtf45 = new JTextField();
			jtf45.setBackground(new Color(238, 232, 170));
			jtf45.setColumns(10);
			jtf45.setBounds(170, 121, 28, 25);
			jtf45.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf45.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf45,(byte)4, (byte)5);
				}
			});
		}
		return jtf45;
	}
	private JTextField getJ28() {
		if (jtf44 == null){
			jtf44 = new JTextField();
			jtf44.setBackground(new Color(238, 232, 170));
			jtf44.setColumns(10);
			jtf44.setBounds(142, 121, 28, 25);
			jtf44.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf44.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf44,(byte)4, (byte)4);
				}
			});
		}
		return jtf44;
	}
	private JTextField getJ27() {
		if (jtf43 == null){
			jtf43 = new JTextField();
			jtf43.setBackground(new Color(255, 255, 255));
			jtf43.setColumns(10);
			jtf43.setBounds(114, 121, 28, 25);
			jtf43.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf43.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf43,(byte)4, (byte)3);
				}
			});
		}		return jtf43;
	}
	private JTextField getJ26() {
		if (jtf42 == null){
			jtf42 = new JTextField();
			jtf42.setBackground(new Color(255, 255, 255));
			jtf42.setColumns(10);
			jtf42.setBounds(86, 121, 28, 25);
			jtf42.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf42.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf42,(byte)4, (byte)2);
				}
			});
		}		return jtf42;
	}
	private JTextField getJ25() {
		if (jtf41 == null){
			jtf41 = new JTextField();
			jtf41.setDisabledTextColor(new Color(0, 0, 0));
			jtf41.setBackground(new Color(255, 222, 173));
			jtf41.setColumns(10);
			jtf41.setBounds(58, 121, 28, 25);
			jtf41.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf41.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf41,(byte)4, (byte)1);
				}
			});
		}
		return jtf41;
	}
	private JTextField getJ24() {
		if (jtf40 == null){
			jtf40 = new JTextField();
			jtf40.setBackground(new Color(204, 204, 204));
			jtf40.setColumns(10);
			jtf40.setBounds(30, 121, 28, 25);
			jtf40.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf40.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf40,(byte)4, (byte)0);
				}
			});
		}		return jtf40;
	}
	private JTextField getJ23() {
		if (jtf35 == null){
			jtf35 = new JTextField();
			jtf35.setBackground(new Color(250, 235, 215));
			jtf35.setColumns(10);
			jtf35.setBounds(170, 96, 28, 25);
			jtf35.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf35.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf35,(byte)3, (byte)5);
				}
			});
		}		return jtf35;
	}
	private JTextField getJ22() {
		if (jtf34 == null){
			jtf34 = new JTextField();
			jtf34.setBackground(new Color(224, 255, 255));
			jtf34.setColumns(10);
			jtf34.setBounds(142, 96, 28, 25);
			jtf34.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf34.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf34,(byte)3, (byte)4);
				}
			});
		}		return jtf34;
	}
	private JTextField getJ21() {
		if (jtf33 == null){
			jtf33 = new JTextField();
			jtf33.setBackground(new Color(205, 92, 92));
			jtf33.setColumns(10);
			jtf33.setBounds(114, 96, 28, 25);
			jtf33.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf33.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf33,(byte)3, (byte)3);
				}
			});
		}		return jtf33;
	}
	private JTextField getJ20() {
		if (jtf32 == null){
			jtf32 = new JTextField();
			jtf32.setBackground(new Color(205, 92, 92));
			jtf32.setColumns(10);
			jtf32.setBounds(86, 96, 28, 25);
			jtf32.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf32.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf35,(byte)3, (byte)2);
				}
			});
		}		
		return jtf32;
	}
	private JTextField getJ19() {
		if (jtf31 == null){
			jtf31 = new JTextField();
			jtf31.setBackground(new Color(255, 222, 173));
			jtf31.setColumns(10);
			jtf31.setBounds(58, 96, 28, 25);
			jtf31.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf31.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf31,(byte)3, (byte)1);
				}
			});
		}		return jtf31;
	}
	private JTextField getJ18() {
		if (jtf30 == null){
			jtf30 = new JTextField();
			jtf30.setBackground(new Color(204, 204, 204));
			jtf30.setColumns(10);
			jtf30.setBounds(30, 96, 28, 25);
			jtf30.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf30.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf30,(byte)3, (byte)0);
				}
			});
		}		return jtf30;
	}
	private JTextField getJ17() {
		if (jtf25 == null){
			jtf25 = new JTextField();
			jtf25.setBackground(new Color(250, 235, 215));
			jtf25.setColumns(10);
			jtf25.setBounds(170, 71, 28, 25);
			jtf25.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf25.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf25,(byte)2, (byte)5);
				}
			});
		}		return jtf25;
	}
	private JTextField getJ16() {
		if (jtf24 == null){
			jtf24 = new JTextField();
			jtf24.setBackground(new Color(224, 255, 255));
			jtf24.setColumns(10);
			jtf24.setBounds(142, 71, 28, 25);
			jtf24.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf24.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf24,(byte)2, (byte)4);
				}
			});
		}		return jtf24;
	}
	private JTextField getJ15() {
		if (jtf23 == null){
			jtf23 = new JTextField();
			jtf23.setBackground(new Color(224, 255, 255));
			jtf23.setColumns(10);
			jtf23.setBounds(114, 71, 28, 25);
			jtf23.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf23.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf23,(byte)2, (byte)3);
				}
			});
		}		return jtf23;
	}
	private JTextField getJ14() {
		if (jtf22 == null){
			jtf22 = new JTextField();
			jtf22.setBackground(new Color(224, 255, 255));
			jtf22.setColumns(10);
			jtf22.setBounds(86, 71, 28, 25);
			jtf22.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf22.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf22,(byte)2, (byte)2);
				}
			});
		}		return jtf22;
	}
	private JTextField getJ13() {
		if (jtf21 == null){
			jtf21 = new JTextField();
			jtf21.setCaretColor(new Color(0, 0, 0));
			jtf21.setBackground(new Color(144, 238, 144));
			jtf21.setColumns(10);
			jtf21.setBounds(58, 71, 28, 25);
			jtf21.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf21.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf21,(byte)2, (byte)1);
				}
			});
		}		return jtf21;
	}
	private JTextField getJ12() {
		if (jtf20 == null){
			jtf20 = new JTextField();
			jtf20.setBackground(new Color(255, 255, 153));
			jtf20.setColumns(10);
			jtf20.setBounds(30, 71, 28, 25);
			jtf20.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf20.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf20,(byte)2, (byte)0);
				}
			});
		}	
		return jtf20;
	}
	private JTextField getJ11() {	
		if (jtf15 == null){
			jtf15 = new JTextField();
			jtf15.setBackground(new Color(255, 204, 0));
			jtf15.setColumns(10);
			jtf15.setBounds(170, 46, 28, 25);
			
			jtf15.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf15.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf15,(byte)1, (byte)5);
				}
			});
		}
		return jtf15;
	}
	private JTextField getJ10() {
		if (jtf14 == null){
			jtf14 = new JTextField();
			jtf14.setBackground(new Color(255, 204, 0));
			jtf14.setColumns(10);
			jtf14.setBounds(142, 46, 28, 25);
			jtf14.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf14.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf14,(byte)1, (byte)4);
				}
			});
		}
		return jtf14;
	}
	private JTextField getJ9() {
		if (jtf13 == null){
			jtf13 = new JTextField();
			jtf13.setBackground(new Color(255, 255, 0));
			jtf13.setColumns(10);
			jtf13.setBounds(114, 46, 28, 25);
			jtf13.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf13.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf13,(byte)1, (byte)3);
				}
			});
		}
		return jtf13;
	}
	private JTextField getJ8() {
		if (jtf12 == null){
			jtf12 = new JTextField();
			jtf12.setBackground(new Color(255, 255, 0));
			jtf12.setColumns(10);
			jtf12.setBounds(86, 46, 28, 25);
			jtf12.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf12.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf12,(byte)1, (byte)2);
				}
			});
			
		}
		return jtf12;
	}
	private JTextField getJ7() {
		if (jtf05 == null){
			jtf05 = new JTextField();
			jtf05.setBackground(new Color(255, 204, 0));
			jtf05.setColumns(10);
			jtf05.setBounds(170, 21, 28, 25);
			jtf05.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));			
			jtf05.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf05,(byte)0, (byte)5);
				}
			});
		}
		return jtf05;
	}
	private JTextField getJ6() {
		if (jtf04 == null){
			jtf04 = new JTextField();
			jtf04.setBackground(new Color(255, 0, 0));
			jtf04.setColumns(10);
			jtf04.setBounds(142, 21, 28, 25);
			jtf04.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf04.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf04,(byte)0, (byte)4);
				}
			});
		}
		return jtf04;
	}
	private JTextField getJ5() {
		if (jtf03 == null){
			jtf03 = new JTextField();
			jtf03.setBackground(new Color(255, 0, 0));
			jtf03.setColumns(10);
			jtf03.setBounds(114, 21, 28, 25);
			jtf03.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf03.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf03,(byte)0, (byte)3);
				}
			});
		}

		return jtf03;
	}
	
	private JTextField getJ() {
		if (jtf10 == null){
			jtf10 = new JTextField();
			jtf10.setBackground(new Color(255, 255, 153));
			jtf10.setColumns(10);
			jtf10.setBounds(30, 46, 28, 25);
			jtf10.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf10.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf10,(byte)1, (byte)0);
				}
			});

		}
		return jtf10;
	}
	
	private JTextField getJ1() {
		if (jtf11 == null){
			jtf11 = new JTextField();
			jtf11.setBackground(new Color(144, 238, 144));
			jtf11.setColumns(10);
			jtf11.setBounds(58, 46, 28, 25);
			jtf11.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf11.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf11,(byte)1, (byte)1);
				}
			});
		}
		
		return jtf11;
	}
	
	private JTextField getJ2() {
		if (jtf00 == null){
			jtf00 = new JTextField();
			jtf00.setForeground(new Color(0, 0, 0));
			jtf00.setBackground(new Color(255, 255, 153));
			jtf00.setBounds(30, 21, 28, 25);
			jtf00.setColumns(10);
			jtf00.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf00.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf00,(byte)0, (byte)0);
				}
			});
		}	
		return jtf00;
	}
	private JTextField getJ3() {
		if (jtf01 == null){
			jtf01 = new JTextField();
			jtf01.setBackground(new Color(153, 204, 255));
			jtf01.setColumns(10);
			jtf01.setBounds(58, 21, 28, 25);
			jtf01.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf01.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf01,(byte)0, (byte)1);
				}
			});
		}
		return jtf01;
	}
	private JTextField getJ4() {
		if (jtf02 == null){
			jtf02 = new JTextField();
			jtf02.setBackground(new Color(153, 204, 255));
			jtf02.setColumns(10);
			jtf02.setBounds(86, 21, 28, 25);
			jtf02.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
			jtf02.addKeyListener(new KeyAdapter() {
				@Override
				public void keyReleased(KeyEvent arg0) {
					jugadorColoca(jtf02,(byte)0, (byte)2);
				}
			});
		}
		return jtf02;
	}

	protected void jugadorColoca(JTextField jtf, byte fila, byte columna) {
		String sNumero=jtf.getText();
		sNumero=sNumero.trim();
		if (sNumero.length()>0) {
			try {
				byte numero=Byte.parseByte(sNumero);
				this.ventanaJugador.jugadorColoca((byte)0, numero, fila, columna); //color que sea el area
			}
			catch (Exception ex) {
			}
		} else
			try {
				this.ventanaJugador.jugadorQuita((byte)0, fila, columna);
			} catch (RemoteException e) {
			}
	}
	
	/**
	 * @param c
	 * @param filaCasilla
	 * @param columnaCasilla
	 */
	public void putValue(char numero, int filaCasilla, int columnaCasilla, char c) {
		JTextField j=null; 
		if (filaCasilla==0) {
			if (columnaCasilla==0)
				j=this.jtf00;
			else if (columnaCasilla==1)
				j=this.jtf01;
			else if (columnaCasilla==2)
				j=this.jtf02;
			else if (columnaCasilla==3)
				j=this.jtf03;
			else if (columnaCasilla==4)
				j=this.jtf04;
			else if (columnaCasilla==5)
				j=this.jtf05;			
		} else if (filaCasilla==1) { 
			if (columnaCasilla==0)
				j=this.jtf10;
			else if (columnaCasilla==1)
				j=this.jtf11;
			else if (columnaCasilla==2)
				j=this.jtf12;
			else if (columnaCasilla==3)
				j=this.jtf13;
			else if (columnaCasilla==4)
				j=this.jtf14;
			else if (columnaCasilla==5)
				j=this.jtf15;
		} else if (filaCasilla==2) {
			if (columnaCasilla==0)
				j=this.jtf20;
			else if (columnaCasilla==1)
				j=this.jtf21;
			else if (columnaCasilla==2)
				j=this.jtf22;
			else if (columnaCasilla==3)
				j=this.jtf23;
			else if (columnaCasilla==4)
				j=this.jtf24;
			else if (columnaCasilla==5)
				j=this.jtf25;			
		} else if (filaCasilla==3) { 
			if (columnaCasilla==0)
				j=this.jtf30;
			else if (columnaCasilla==1)
				j=this.jtf31;
			else if (columnaCasilla==2)
				j=this.jtf32;
			else if (columnaCasilla==3)
				j=this.jtf33;
			else if (columnaCasilla==4)
				j=this.jtf34;
			else if (columnaCasilla==5)
				j=this.jtf35;
		} else if (filaCasilla==4) { 
			if (columnaCasilla==0)
				j=this.jtf40;
			else if (columnaCasilla==1)
				j=this.jtf41;
			else if (columnaCasilla==2)
				j=this.jtf42;
			else if (columnaCasilla==3)
				j=this.jtf43;
			else if (columnaCasilla==4)
				j=this.jtf44;
			else if (columnaCasilla==5)
				j=this.jtf45;
		} else if (filaCasilla==5) { 
			if (columnaCasilla==0)
				j=this.jtf50;
			else if (columnaCasilla==1)
				j=this.jtf51;
			else if (columnaCasilla==2)
				j=this.jtf52;
			else if (columnaCasilla==3)
				j=this.jtf53;
			else if (columnaCasilla==4)
				j=this.jtf54;
			else if (columnaCasilla==5)
				j=this.jtf55;
		} 
		String sNumero="" + numero;
		if (sNumero.equals("0"))
			sNumero="";
		j.setText(sNumero);
		j.setBackground(getColor(c));
	}
	
	public Color getColor(char c){
		Color t;
		if (c == 'b') t = new Color(255, 255, 255); //blanco
		else if (c == 'a') t = new Color(0, 153, 204); //azul
		else if (c == 'v') t = new Color(153, 255, 051); //verde
		else if (c == 'r') t = new Color(255, 0, 0); //rojo
		else if (c == 'm') t = new Color(255, 255, 0); //amarillo
		else if (c == 'p') t = new Color(255, 0, 120); //rosa
		else t = new Color(255, 255, 255);
		
		return t;
		}

	/**
	 *  
	 * @uml.property name="ventanaJugador"
	 * 
	 */
	public void setVentanaJugador(IVentanaJugador ventanaJugador) {
		this.ventanaJugador = ventanaJugador;
	}
/**
	 * @return
	 */
	public String getKenken() {
		String result="";
		result+=(this.jtf10.getText().trim().length()==0 ? "0" : this.jtf10.getText().trim()) +
				(this.jtf11.getText().trim().length()==0 ? "0" : this.jtf11.getText().trim()) +
				(this.jtf00.getText().trim().length()==0 ? "0" : this.jtf00.getText().trim()) +
				(this.jtf01.getText().trim().length()==0 ? "0" : this.jtf01.getText().trim()) +
				(this.jtf02.getText().trim().length()==0 ? "0" : this.jtf02.getText().trim()) +
				(this.jtf03.getText().trim().length()==0 ? "0" : this.jtf03.getText().trim()) +
				(this.jtf04.getText().trim().length()==0 ? "0" : this.jtf04.getText().trim()) +
				(this.jtf05.getText().trim().length()==0 ? "0" : this.jtf05.getText().trim()) +
				(this.jtf12.getText().trim().length()==0 ? "0" : this.jtf12.getText().trim()) +
				(this.jtf13.getText().trim().length()==0 ? "0" : this.jtf13.getText().trim()) +
				(this.jtf14.getText().trim().length()==0 ? "0" : this.jtf14.getText().trim()) +
				(this.jtf15.getText().trim().length()==0 ? "0" : this.jtf15.getText().trim()) +
				(this.jtf20.getText().trim().length()==0 ? "0" : this.jtf20.getText().trim()) +
				(this.jtf21.getText().trim().length()==0 ? "0" : this.jtf21.getText().trim()) +
				(this.jtf22.getText().trim().length()==0 ? "0" : this.jtf22.getText().trim()) +
				(this.jtf23.getText().trim().length()==0 ? "0" : this.jtf23.getText().trim()) +
				(this.jtf24.getText().trim().length()==0 ? "0" : this.jtf24.getText().trim()) +
				(this.jtf25.getText().trim().length()==0 ? "0" : this.jtf25.getText().trim()) +
				(this.jtf30.getText().trim().length()==0 ? "0" : this.jtf30.getText().trim()) +
				(this.jtf31.getText().trim().length()==0 ? "0" : this.jtf31.getText().trim()) +
				(this.jtf32.getText().trim().length()==0 ? "0" : this.jtf32.getText().trim()) +
				(this.jtf33.getText().trim().length()==0 ? "0" : this.jtf33.getText().trim()) +
				(this.jtf34.getText().trim().length()==0 ? "0" : this.jtf34.getText().trim()) +
				(this.jtf35.getText().trim().length()==0 ? "0" : this.jtf35.getText().trim()) +
				(this.jtf40.getText().trim().length()==0 ? "0" : this.jtf40.getText().trim()) +
				(this.jtf41.getText().trim().length()==0 ? "0" : this.jtf41.getText().trim()) +
				(this.jtf42.getText().trim().length()==0 ? "0" : this.jtf42.getText().trim()) +
				(this.jtf43.getText().trim().length()==0 ? "0" : this.jtf43.getText().trim()) +
				(this.jtf44.getText().trim().length()==0 ? "0" : this.jtf44.getText().trim()) +
				(this.jtf45.getText().trim().length()==0 ? "0" : this.jtf45.getText().trim()) +
				(this.jtf50.getText().trim().length()==0 ? "0" : this.jtf50.getText().trim()) +
				(this.jtf51.getText().trim().length()==0 ? "0" : this.jtf51.getText().trim()) +
				(this.jtf52.getText().trim().length()==0 ? "0" : this.jtf52.getText().trim()) +
				(this.jtf53.getText().trim().length()==0 ? "0" : this.jtf53.getText().trim()) +
				(this.jtf54.getText().trim().length()==0 ? "0" : this.jtf54.getText().trim()) +
				(this.jtf55.getText().trim().length()==0 ? "0" : this.jtf55.getText().trim());
		return result;
	}

	/**
	 *  
	 * @uml.property name="ventanaJugador"
	 * @uml.associationEnd inverse="jPCuadricula:sudoku.client.presen.IVentanaJugador" multiplicity="(0 1)"
	 * 
	 */
	private IVentanaJugador ventanaJugador;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JTextField textField_4;
	private JTextField textField_5;

	/**
	 *  
	 * @uml.property name="ventanaJugador"
	 * 
	 */
	public IVentanaJugador getVentanaJugador() {
		return ventanaJugador;
	}

	private JTextField getTextField() {
		if (textField == null) {
			textField = new JTextField();
			textField.setText("  +");
			textField.setEditable(false);
			textField.setBounds(229, 34, 28, 25);
			textField.setBackground(new Color(255,255,255));
			textField.setColumns(10);
		}
		return textField;
	}
	private JTextField getTextField_1() {
		if (textField_1 == null) {
			textField_1 = new JTextField();
			textField_1.setText("  +");
			textField_1.setEditable(false);
			textField_1.setBounds(267, 34, 28, 25);
			textField_1.setColumns(10);
			textField_1.setBackground(new Color(0, 153, 204));
		}
		return textField_1;
	}
	private JTextField getTextField_2() {
		if (textField_2 == null) {
			textField_2 = new JTextField();
			textField_2.setEditable(false);
			textField_2.setText("   -");
			textField_2.setBounds(229, 82, 28, 25);
			textField_2.setColumns(10);
			textField_2.setBackground(new Color(153, 255, 051));
		}
		return textField_2;
	}
	private JTextField getTextField_3() {
		if (textField_3 == null) {
			textField_3 = new JTextField();
			textField_3.setEditable(false);
			textField_3.setText("   -");
			textField_3.setBounds(267, 82, 28, 25);
			textField_3.setColumns(10);
			textField_3.setBackground(new Color(255, 0, 0));
		}
		return textField_3;
	}
	private JTextField getTextField_4() {
		if (textField_4 == null) {
			textField_4 = new JTextField();
			textField_4.setEditable(false);
			textField_4.setHorizontalAlignment(SwingConstants.LEFT);
			textField_4.setText("   *");
			textField_4.setBounds(229, 132, 28, 25);
			textField_4.setColumns(10);
			textField_4.setBackground(new Color(255, 255, 0));
		}
		return textField_4;
	}
	private JTextField getTextField_5() {
		if (textField_5 == null) {
			textField_5 = new JTextField();
			textField_5.setEditable(false);
			textField_5.setText("   *");
			textField_5.setBounds(267, 132, 28, 25);
			textField_5.setColumns(10);
			textField_5.setBackground(new Color(255, 0, 125));
		}
		return textField_5;
	}
}
